<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/taglibs.jsp" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>

<script language="javascript">
  function selectAllBox(){
    var pids  = document.getElementsByName('ids');
    for (var i=0;i<pids.length;i++)
      {
         if(!pids[i].disabled){
             pids[i].checked = document.getElementById("selectAll").checked;
         }
       }
  }
  
  function doDelete(){
      var isSelect =false;
	  var pids  = document.getElementsByName('ids');
	  for (var i=0;i<pids.length;i++)
	  {
	     if(pids[i].checked){
		     isSelect=true;
		     break;
	     }
	  }
      if(isSelect){
         if (confirm('<s:text name="prompt.system.delete.sure"/>')){
		      var form = document.getElementById('mainForm');
		      document.getElementById('act').value='batchDelete';
		      form.action = 'confBlock.action';
		      form.submit();
			  return true;
         }
      }else{
         alert('<s:text name="prompt.system.delete.select"/>');
      }

  }
  
   function sort(_fieldName){
   		var fieldName = document.mainForm.sortField.value;
   		var sortMode='<s:property value="sortMode"/>';
   		if(_fieldName==fieldName){
	   		if('asc'=='<s:property value="sortMode"/>'){
	   		   document.mainForm.sortMode.value='desc';
	   		}
	   		if('desc'=='<s:property value="sortMode"/>'){
	   		   document.mainForm.sortMode.value='asc';
	   		}
   		}else{
   		    document.mainForm.sortField.value=_fieldName;
   		    document.mainForm.sortMode.value='asc';
   		}
   		document.mainForm.act.value="query";
   		document.mainForm.submit();
   }
  function edit(id){
    document.location.href="confBlock.action?act=editInput&id=" + id;
  }
  function dmxAdd(){
    document.location.href="confBlock.action?act=addInput";

  }
  function doImport(){
  	document.location.href="confBlock.action?act=preImport";
  }
  function doExport(){
  	mainForm.atcion="confBlock.action";
  	mainForm.act.value="doExport";
  	mainForm.submit();
  	//document.location.href="confBlock.action?act=doExport";
  }  
  
  function doQuery(){
  	mainForm.atcion="confBlock.action";
  	mainForm.act.value="query";
  	mainForm.submit();
  }
</script>
<body style="overflow-x:hidden;overflow-y:auto;">
<div id="mytest3"></div>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
  <tr><td><table border="0" align="center" cellpadding="0" cellspacing="0">
    <td width="8" height="27"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:text name="cep.confBlock.title"/></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
    </table>
    </td>
  </tr>
  
  <tr>
    <td colspan="3" class="biaoge">	
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	<form name="mainForm" method="post" action="${ctx}/attributeManage/confBlock.action">  
	  <tr>
        <td height="15"></td>
      </tr> 
    
	  <tr>
		<!-- 查询条件 -->
	    <td class="tabulation" colspan="3"><div style="position:relative">
	      <div id="menu1"><img src="${ctx}/core/images/icon_13.gif"><s:text name="info.queryCondition" /></div>

	        <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
		        	<input type="hidden" name="act" id="act" value="query"/>
					<input type="hidden" name="sortField" value="<s:property value="sortField"/>"/>
					<input type="hidden" name="sortMode" value="<s:property value="sortMode"/>" />
			        <tr align="left">
				        <td width="3%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="cep.confBlock.blocktype" /></td>
				        <td bgcolor="#DDE4EA">
				            <select name="q_blocktype">
				            	<option value=""></option>
				            	<option value="1" <s:if test='"1".equals(q_blocktype)'>selected</s:if> ><s:text name="cep.confBlock.blocktype.1" /></option>
				            	<option value="0" <s:if test='"0".equals(q_blocktype)'>selected</s:if>><s:text name="cep.confBlock.blocktype.0" /></option>
				            </select>
				        </td>
				        <td width="3%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="cep.confBlock.blackorwhite" /></td>
				        <td bgcolor="#DDE4EA">
				            <select name="q_blackorwhite">
				            	<option value=""></option>
				            	<option value="1" <s:if test='"1".equals(q_blackorwhite)'>selected</s:if> ><s:text name="cep.confBlock.blackorwhite.1" /></option>
				            	<option value="0" <s:if test='"0".equals(q_blackorwhite)'>selected</s:if>><s:text name="cep.confBlock.blackorwhite.0" /></option>
				            </select>
				        </td>
				    </tr> 
				    <tr align="left">		    
				        <td width="3%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="cep.confBlock.flag" /></td>
				        <td bgcolor="#DDE4EA">
				            <select name="q_flag">
				            	<option value=""></option>
				            	<option value="1" <s:if test='"1".equals(q_flag)'>selected</s:if> ><s:text name="cep.confBlock.flag.yes" /></option>
				            	<option value="0" <s:if test='"0".equals(q_flag)'>selected</s:if>><s:text name="cep.confBlock.flag.no" /></option>
				            </select>
				        </td>
				        <td width="3%" bgcolor="#DDE4EA" nowrap="nowrap">&nbsp;&nbsp;<s:text name="cep.confBlock.value" /></td>
				        <td bgcolor="#DDE4EA">
				            <exts:textfield id="q_value" name="q_value" value="%{q_value}" class="textbox_css" style="width:150px"/>
				        </td>
				    </tr> 	       	
    		        <tr>
			        	<td height="20" colspan="6" align="right" bgcolor="#DDE4EA">
						   <input type="button" class="btn" name="quary" value="<s:text name='button.query' />" onclick="doQuery();"/>
				        </td>
			        </tr>		       
		       
			</table> </div></td>
	<!-- 查询条件结束 -->

  </tr>
  <tr>
    <td height="5"></td>
  </tr>
  <tr>
    <td height="10" background="${ctx}/core/images/line5.gif"></td>
    </tr>
  <tr>
    <td height="5"></td>
  </tr>

	      <tr>
	        <td height="25" align="left">
		        <input type="button" name="del" value="<s:text name="button.delete" />" class="btn" onClick="doDelete();">
		        <input type="button" name="add" value="<s:text name="button.new" />" class="btn" onClick="dmxAdd();">
		        <input type="button" name="import" value="<s:text name="button.import" />" class="btn" onClick="doImport();">
		        <input type="button" name="export" value="<s:text name="button.export" />" class="btn" onClick="doExport();">
	        </td>
	      </tr>
	      </table>
      <table id="content" width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#A6A6A6">
        
        <tr bgcolor="#C7D6EA">
          <td  width="2%" height="20" align="center" class="table_head">
               <span>
           		 <input type="checkbox" name="selectAll" onClick="selectAllBox()" >
           	  </span>
          </td>
          <td  align="center" class="table_head" ><a href="javascript:sort('tcb.BLOCKTYPE')"><s:text name="cep.confBlock.blocktype" /></a><s:if test="sortField=='tcb.BLOCKTYPE'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td  align="center" class="table_head" ><a href="javascript:sort('tcb.BLACKORWHITE')"><s:text name="cep.confBlock.blackorwhite" /></a><s:if test="sortField=='tcb.BLACKORWHITE'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td  align="center" class="table_head" ><a href="javascript:sort('tcb.VALUE')"><s:text name="cep.confBlock.flag" /></a><s:if test="sortField=='tcb.VALUE'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td  align="center" class="table_head" ><a href="javascript:sort('tcb.FLAG')"><s:text name="cep.confBlock.value" /></a><s:if test="sortField=='tcb.FLAG'"><s:if test="sortMode=='asc'"><font color="red">↑</font></s:if><s:else><font color="red">↓</font></s:else></s:if></td>
          <td  align="center" class="table_head"><s:text name="info.operate" /></td>
        </tr>
 		
 		<s:iterator value="pageInfo.searchResult" id="it" status="st">
	        <tr>
				<td align="center" class="tdBlue">
				     <input type="checkbox" name="ids" value="<exts:property value="0"/>"/>
				</td>
				<td align="center">
					<s:if test='"0".equals(#it[1])'><s:text name="cep.confBlock.blocktype.0"/></s:if>
                    <s:if test='"1".equals(#it[1])'><s:text name="cep.confBlock.blocktype.1"/></s:if>
	            </td>
				<td align="center">
					<s:if test='"0".equals(#it[2])'><s:text name="cep.confBlock.blackorwhite.0"/></s:if>
                    <s:if test='"1".equals(#it[2])'><s:text name="cep.confBlock.blackorwhite.1"/></s:if>
	            </td>
				<td align="center">
					<s:if test='"0".equals(#it[4])'><s:text name="cep.confBlock.flag.no"/></s:if>
                    <s:if test='"1".equals(#it[4])'><s:text name="cep.confBlock.flag.yes"/></s:if>
	            </td>


				<td align="center"><exts:property value="3"/></td>
				
		          <td align="center">
		          	<table height="16" border="0" cellpadding="0" cellspacing="0">
		                <tr>
			                <td width="22" align="right"><a href="javascript:edit('<exts:property value='0'/>')"><img src="${ctx}/core/images/edit.gif" name="icon_064" width="16" height="16" border="0" id="icon_064" style="CURSOR: hand" title="<s:text name='button.edit' />"/></a></td>
		                </tr>
		          	</table>
		          </td>
	        </tr>
	    </s:iterator>
	 </form>
      </table>

      <!-- 分页 -->	  
		  <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr><td>${pagination}</td></tr>
          </table>
          
      <!-- 分页结束 -->	
    </td></tr></table>
</body>

<script>
	tables('content',null);
</script>